作者:Andg在路上 | 来源:互联网 | 2023-01-29 14:01
当我跑
composer require --dev phpunit/phpunit
我收到以下消息:
composer require --dev phpunit/phpunit
Using version ^6.2 for phpunit/phpunit
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for sebastian/object-enumerator (locked at 2.0.1) -> satisfiable by sebastian/object-enumerator[2.0.1].
- phpunit/phpunit 6.2.0 requires sebastian/object-enumerator ^3.0.2 -> satisfiable by sebastian/object-enumerator[3.0.2].
- phpunit/phpunit 6.2.1 requires sebastian/object-enumerator ^3.0.2 -> satisfiable by sebastian/object-enumerator[3.0.2].
- phpunit/phpunit 6.2.2 requires sebastian/object-enumerator ^3.0.2 -> satisfiable by sebastian/object-enumerator[3.0.2].
- phpunit/phpunit 6.2.3 requires sebastian/object-enumerator ^3.0.2 -> satisfiable by sebastian/object-enumerator[3.0.2].
- Conclusion: don't install sebastian/object-enumerator 3.0.2
- Installation request for phpunit/phpunit ^6.2 -> satisfiable by phpunit/phpunit[6.2.0, 6.2.1, 6.2.2, 6.2.3].
Installation failed, reverting ./composer.json to its original content.
这是我的作曲家json文件:
"require": {
"php": "^7.0",
"laravel/framework": "^5.4",
"guzzlehttp/guzzle": "^6.3",
"symfony/psr-http-message-bridge": "^1.0",
"mcamara/laravel-localization": "^1.2",
"laravelcollective/html": "^5.4",
"laravel/socialite": "^3.0",
"yajra/laravel-datatables-oracle": "^7.9"
},
"require-dev": {
"fzaninotto/faker": "^1.6",
"symfony/css-selector": "^3.3",
"symfony/dom-crawler": "^3.3"
}
我试图从上面的5.4版本获得类似的错误,但与其他dependecies,唯一似乎工作的版本是5.0
1> localheinz..:
跑
$ composer require --dev phpunit/phpunit --update-with-dependencies
请参阅https://getcomposer.org/doc/03-cli.md#require:
--update-with-dependencies:还更新新所需包的依赖关系.
注意composer.lock
在这种情况下删除并不是最好的主意,因为它可能会导致在其他地方破坏代码的依赖项.您实际上只想一次更新特定的依赖项,而不是一次更新所有依赖项.